<?=modules::run("website/big_images/installations");?>  

  
  <div id="content-wrap">
  <div class="inner">

    <div class="left">

    <? // Wishlist manager
        if (isset($wishlist)) print modules::run("website/wishlist_module/wishlist_manager", $wishlist['id_Wishlists']);
        else print modules::run("website/wishlist_module/wishlist_manager");
    ?>                                                            

    <? // Submenu
        if (isset($wishlist)) print modules::run("subnavigation/submenu/wishlist", $wishlist['id_Wishlists']);
        else print modules::run("subnavigation/submenu/wishlist");
    ?>                                                              

    </div>


    
    <div class="right">
                                                            
    <? // Breadcrumbs
        if (isset($wishlist)) {
            $breadcrumbs[] = array('display' => 'wish list', 'controller' => 'wishlist', 'title' => 'Wish List');
            $breadcrumbs[] = array('display' => $wishlist['Title_Wishlists']);
        } else {
            $breadcrumbs[] = array('display' => 'wish list');                                              
        }

        print modules::run("subnavigation/breadcrumb/view", $breadcrumbs);
    ?>                                                               
 
    <h1><?=$header["title"]?></h1>

    <? if($header["intro"] != ""){ ?>
    <h6><?=$header["intro"]?></h6>
    <? } ?>

    <? if($header["description"] != ""){ ?>
    <div class="sansserif"><?=$header["description"]?></div>
    <? } ?>   


     <? if(!empty($list['items'])){ ?>

<script type="text/javascript">
jQuery(document).ready(function(jQuery) {

//_________________________
// Enquire about products

	// one checkbox to rule them all
    jQuery('.check_all').click(function(){
        jQuery('.checkbox').attr('checked', jQuery(this).is(':checked') );
    });

	/*
	// create the overlay -- I should just create it in html, not with js
	jQuery('#overlay').clone(false).attr("id","overlay_enquire").prependTo("body");	
	*/

	// Enquire about products, the click
	jQuery(".enquire").click(function(e){ 
		
		// put products into array
		product_ids = new Array();	
		jQuery(".checkbox[name=product_checkbox]:checked").each(function(index)
		{
			product_ids.push(jQuery(this).val());
		});
		// clean duplicates
		var seen = {};
		if (product_ids.length>0) {
			for(i=product_ids.length-1; i>=0; i--) {
				if (seen[product_ids[i]]) {
					product_ids.splice(i,1);
				} else {
					seen[product_ids[i]] = true;
				}
			}
		}
		
		var data = { 'products[]': product_ids };
		jQuery.openOverlay('<?=site_url('wishlist/overlay_enquire') ?>', data);
		
		/*		
		// post products array to controller
		jQuery.ajax({
			type: 'POST',
			url: '<?=site_url('wishlist/overlay_enquire')?>',
			data: { 'products[]': product_ids },
			success: function(response){ 
				// populate the overlay with returned data
				jQuery('#overlay_enquire .overlay_container').html(response);
				// open the overlay
				jQuery("#overlay_enquire").overlay({
					expose: { color: '#FFF', loadSpeed: 400, opacity: 0.5 },   
					closeOnClick: true,
					api: true 
				}).load(); 			
			}
		});
		*/
		
		return false;
	});

});
</script>

     <p class="sansserif">Select All: 
          <input class="checkbox check_all" type="checkbox" value="checkbox" name="checkbox">&nbsp; 
          | &nbsp;
          <a class="enquire" href="#">Enquire about selected products</a>
     </p>

     <? } ?>

<?
    foreach($list['items'] as $group) 
    {
?>            

        <div class="headercontain">
            <p><?=$group['name']?></p>
        </div>

        <? 
        $group['controller'] = $list['controller'];
        $group['wishlist_id'] = $group['params'];
        $this->load->view('website/lists/wishlist_items', $group); 
        ?>

<? 
    }
?>  


<? if(!empty($list['items'])){ ?>

    <div class="summarycontainer">
        <a class="print_button" href="#">
            <img height="36" border="0" width="48" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('print','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/print-left_f2.gif',1)" id="print" class="horizontalbutton" name="print" alt="print" src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/print-left.gif"/>
        </a>
        <script type="text/javascript">  
            $$('.print_button').addEvent('click',function(e){ 
                new Event(e).stop();
                window.print();
            });
        </script>
        <a rel="overlay" href="<?=site_url('email_colleague/index/wishlist/'.(count($list['items'])>1?"ALL":$list['items'][0]['params']))?>">
            <img src="<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/email.gif" alt="email to collegue" name="email" width="60" height="36" border="0" class="horizontalbutton" id="email" onmouseover="MM_swapImage('email','','<?=base_url()?>assets/website/images/buttons<?=INSTANCE_FILE_SUFFIX ?>/email_f2.gif',1)" onmouseout="MM_swapImgRestore()" />
        </a>
    </div>


     <p class="sansserif">Select All: 
          <input class="checkbox check_all" type="checkbox" value="checkbox" name="checkbox2">&nbsp; 
          | &nbsp;
          <a class="enquire" href="#">Enquire about selected products</a>
     </p>

<? } ?>

    <div class="widget">    
        <!-- AddThis Button BEGIN -->
        <a href="http://www.addthis.com/bookmark.php?v=250" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/static/btn/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a360d252cc10889"></script>
        <script type="text/javascript">
        var addthis_exclude = 'email, print';
        </script>
        <!-- AddThis Button END -->
    </div>

        
    </div>
  </div>
  </div>
